3.5 \(\int \frac {\sec (x)}{i+\cot (x)} \, dx\)

Optimal. Leaf size=18 \[ i \sin (x)-\cos (x)-i \tanh ^{-1}(\sin (x)) \]

[Out]

-I*arctanh(sin(x))-cos(x)+I*sin(x)

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.636, Rules used = {3518, 3108, 3107, 2638, 2592, 321, 206} \[ i \sin (x)-\cos (x)-i \tanh ^{-1}(\sin (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]/(I + Cot[x]),x]

[Out]

(-I)*ArcTanh[Sin[x]] - Cos[x] + I*Sin[x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2592

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, (a*Sin[e + f*x])/ff
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3107

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*sin[c + d*x]^n*(a*cos[c + d*x] + b*sin[c +
 d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IGtQ[p, 0]

Rule 3108

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_), x_Symbol] :> Dist[a^p*b^p, Int[(Cos[c + d*x]^m*Sin[c + d*x]^n)/(b*Cos[c + d*x] + a*Sin
[c + d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[a^2 + b^2, 0] && ILtQ[p, 0]

Rule 3518

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[(Sin[e + f*x]
^m*(a*Cos[e + f*x] + b*Sin[e + f*x])^n)/Cos[e + f*x]^n, x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
 ILtQ[n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))

Rubi steps

\begin {align*} \int \frac {\sec (x)}{i+\cot (x)} \, dx &=-\int \frac {\tan (x)}{-\cos (x)-i \sin (x)} \, dx\\ &=i \int (-i \cos (x)-\sin (x)) \tan (x) \, dx\\ &=i \int (-i \sin (x)-\sin (x) \tan (x)) \, dx\\ &=-(i \int \sin (x) \tan (x) \, dx)+\int \sin (x) \, dx\\ &=-\cos (x)-i \operatorname {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (x)\right )\\ &=-\cos (x)+i \sin (x)-i \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (x)\right )\\ &=-i \tanh ^{-1}(\sin (x))-\cos (x)+i \sin (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.04, size = 44, normalized size = 2.44 \[ -\cos (x)+i \left (\sin (x)+\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]/(I + Cot[x]),x]

[Out]

-Cos[x] + I*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]] + Sin[x])

________________________________________________________________________________________

fricas [B]  time = 0.55, size = 33, normalized size = 1.83 \[ {\left (-i \, e^{\left (i \, x\right )} \log \left (e^{\left (i \, x\right )} + i\right ) + i \, e^{\left (i \, x\right )} \log \left (e^{\left (i \, x\right )} - i\right ) - 1\right )} e^{\left (-i \, x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(I+cot(x)),x, algorithm="fricas")

[Out]

(-I*e^(I*x)*log(e^(I*x) + I) + I*e^(I*x)*log(e^(I*x) - I) - 1)*e^(-I*x)

________________________________________________________________________________________

giac [B]  time = 0.39, size = 29, normalized size = 1.61 \[ \frac {2 i}{\tan \left (\frac {1}{2} \, x\right ) - i} - i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) + 1\right ) + i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(I+cot(x)),x, algorithm="giac")

[Out]

2*I/(tan(1/2*x) - I) - I*log(tan(1/2*x) + 1) + I*log(tan(1/2*x) - 1)

________________________________________________________________________________________

maple [B]  time = 0.30, size = 34, normalized size = 1.89 \[ \frac {2 i}{\tan \left (\frac {x}{2}\right )-i}+i \ln \left (\tan \left (\frac {x}{2}\right )-1\right )-i \ln \left (\tan \left (\frac {x}{2}\right )+1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)/(I+cot(x)),x)

[Out]

2*I/(tan(1/2*x)-I)+I*ln(tan(1/2*x)-1)-I*ln(tan(1/2*x)+1)

________________________________________________________________________________________

maxima [B]  time = 0.57, size = 45, normalized size = 2.50 \[ -\frac {2}{\frac {i \, \sin \relax (x)}{\cos \relax (x) + 1} + 1} - i \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right ) + i \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(I+cot(x)),x, algorithm="maxima")

[Out]

-2/(I*sin(x)/(cos(x) + 1) + 1) - I*log(sin(x)/(cos(x) + 1) + 1) + I*log(sin(x)/(cos(x) + 1) - 1)

________________________________________________________________________________________

mupad [B]  time = 0.25, size = 21, normalized size = 1.17 \[ -\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,2{}\mathrm {i}+\frac {2{}\mathrm {i}}{\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x)*(cot(x) + 1i)),x)

[Out]

2i/(tan(x/2) - 1i) - atanh(tan(x/2))*2i

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec {\relax (x )}}{\cot {\relax (x )} + i}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(I+cot(x)),x)

[Out]

Integral(sec(x)/(cot(x) + I), x)

________________________________________________________________________________________